//
//  PageViewController.m
//  GFPageController
//
//  Created by 谭高丰 on 2017/4/13.
//  Copyright © 2017年 谭高丰. All rights reserved.
//

#import "PageViewController.h"
#import "SeckillListVC.h"
#import "SeckillDetailsVC.h"
@interface PageViewController ()<SeckillListVCDelegate>

@end

@implementation PageViewController
-(void)didSelectItemAtIndexPath:(NSString *)brand{
    self.hidesBottomBarWhenPushed=YES;
    SeckillDetailsVC *deta=[[SeckillDetailsVC alloc] init];
    [self.navigationController pushViewController:deta animated:YES];
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navBarBgAlpha=@"1.0";
    self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
}
- (void)viewDidLoad {
    [super viewDidLoad];
  
    self.title=Localized(@"限时秒杀");

    UIBarButtonItem* leftBar=[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"返回"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(leftBarAction)];
    self.navigationItem.leftBarButtonItem=leftBar;
    [self configureContentView];
    
}
- (void)configureContentView {
    NSArray *titles             = @[@"8:00",@"10:00",@"12:00",@"14:00",@"16:00",@"18:00",@"20:00"];
    NSArray *subTitles          = @[Localized(@"已结束"),Localized(@"已结束"),Localized(@"已结束"),Localized(@"疯抢中"),Localized(@"即将开始"),Localized(@"即将开始"),Localized(@"即将开始")];
    NSMutableArray *controllers = [NSMutableArray new];
    for (int i = 0; i < 7; i ++) {
        SeckillListVC *vc    = [[SeckillListVC alloc] init];
        vc.delegate=self;
        [controllers addObject:vc];
    }
    
    // 设置控制器数组
    self.gf_controllers = controllers;
    
    self.gf_menuHeight  = 50;
    self.gf_menuY       = 0;
    // 设置标题数组
    self.gf_titles      = titles;
    // 设置副标题数组
    self.gf_subTitles   = subTitles;
    // 设置当前下标
    self.gf_selectIndex = 2;
    // 滚动结束后返回当前下标
    self.gf_curPageIndexBlock = ^(int curPageIndex) {
        NSLog(@"%d",curPageIndex);
    };
    self.gf_maskFillColor=[UIColor colorWithHexString:@"#ffbb07"];
    self.gf_menuBackgroundColor=[UIColor whiteColor];
    self.gf_normalSubTitleColor=[UIColor blackColor];
    self.gf_normalTitleColor=[UIColor blackColor];
    [self reloadView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
